{extend name="public/base" /}

{block name="style"}
<style>
    .user-avatar-preview {
        width: 100px;
    }
    .thumbnail {
        width: 100%;
        margin-bottom: 10px;
    }
</style>
{/block}

{block name="content"}
<div class="container-fluid">
    <div class="breadcrumb-wrapper row">
        <div class="col-12 col-lg-3 col-md-6">
            <h4 class="page-title">编辑会员</h4>
        </div>
        <div class="col-12 col-lg-9 col-md-6">
            <ol class="breadcrumb float-right">
                <li><a href="{:url('Manage/home')}">控制台</a></li>
                <li class="active"> / 编辑会员</li>
            </ol>
        </div>
    </div>
</div>

<div class="container-fluid">
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-body">
                    <form method="post" action="{:url('User/editUserDo')}" enctype="multipart/form-data">
                        {:token()}
                        <input type="hidden" name="id" value="{$info.id}">
                        <div class="form-group">
                            <label>用户名</label>
                            <input class="form-control" type="text" name="username" value="{$info.username}">
                        </div>
                        <div class="form-group">
                            <label>密码</label>
                            <input class="form-control" type="password" name="password" placeholder="不修改密码请留空">
                        </div>
                        <div class="form-group">
                            <label>邮箱</label>
                            <input class="form-control" type="text" name="email" value="{$info.email}">
                        </div>
                        <div class="form-group">
                            <label>手机号</label>
                            <input class="form-control" type="tel" name="mobile" value="{$info.mobile}">
                        </div>
                        <div class="form-group">
                            <label>头像</label>
                            {if $info.avatar != ""}
                            <div class="user-avatar-preview">
                                <a href="/uploads/avatar/{$info.avatar}" target="_blank">
                                    <img src="/uploads/avatar/{$info.avatar}" class="thumbnail">
                                </a>
                            </div>
                            {/if}
                            <input class="form-control" type="file" name="avatar">
                        </div>

                        <div class="form-group">
                            <div class="custom-control custom-radio radio custom-control-inline">
                                <input type="radio" class="custom-control-input" name="status" id="show1" value="1"
                                       {eq name="info.status" value="1"}
                                       checked
                                       {/eq}
                                >
                                <label class="custom-control-label" for="show1">正常</label>
                            </div>
                            <div class="custom-control custom-radio radio custom-control-inline">
                                <input type="radio" class="custom-control-input" name="status" id="hidden1" value="2"
                                       {eq name="info.status" value="2"}
                                       checked
                                       {/eq}
                                >
                                <label class="custom-control-label" for="hidden1">隐藏</label>
                            </div>
                        </div>

                        <br>
                        <button type="submit" class="btn btn-common">提交保存</button>
                        <a href="{:url('User/userList')}" class="btn btn-light">返回列表</a>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

{/block}